import java.util.*;

public class Team {
	private String TeamName;
	private String OwnerName;
	private String Streak;
	private String Record;
	private int TotalPoints;
	private int TotalMoves;
	private List<TeamMem> TeamPlayers = new ArrayList<TeamMem>();
	
	//Default constructor.
	public Team () {
		
	}
	
	//constructor with known team name.
	public Team (String TName) {
		TeamName = TName;
	}
	
	// Add/Remove a member into/out team.
	public void AddTeam (TeamMem P) {
		P.SetTeamName(TeamName);
		TeamPlayers.add(P);	
	}

	public void RemoveTeam (TeamMem P){
		TeamPlayers.remove(P);
	}
	
	//Set Methods
	public void SetTeamName(String Tname) {
		TeamName = Tname;
	}
	
	public void SetOwnerName(String Oname) {
		OwnerName = Oname;
	}
	
	public void SetStreak(String streak) {
		Streak = streak;
	}
	
	public void SetRecord(String record) {
		Record = record;
	}
	
	//Get Methods
	public String GetTeamName() {
		return TeamName;
	}
	
	public String GetOwnerName() {
		return OwnerName;
	}
	
	public int GetTeamSize() {
		return TeamPlayers.size();
	}
	
	public String GetStreak() {
		return Streak;
	}
	
	public String GetRecord() {
		return Record;
	}
	
	public Iterator<TeamMem> GetTeam() {
		return TeamPlayers.iterator();
	}
	
	// Points and Moves calculation.
	public int CalculateTotalPoints() {
		for (int i = 0; i < TeamPlayers.size(); i++){
			TotalPoints += TeamPlayers.get(i).GetPoints();
		}
		return TotalPoints;
	}
	
	public int CalculateTotalMoves() {
		for (int i = 0; i < TeamPlayers.size(); i++){
			TotalMoves += TeamPlayers.get(i).GetMoves();
		}
		return TotalMoves;
	}
}
